package Model;

import java.sql.Timestamp;

public class Transaction {
    private int id;
    private int userId;
    private Integer recipientId;  // 使用 Integer，允许为空
    private String transactionType;
    private double amount;
    private double totalBalance;
    private Timestamp transactionDate;
    private String description;

    public Transaction() {
    }

    public Transaction(int id, int userId, Integer recipientId, String transactionType,
                       double amount, double totalBalance, Timestamp transactionDate, String description) {
        this.id = id;
        this.userId = userId;
        this.recipientId = recipientId;
        this.transactionType = transactionType;
        this.amount = amount;
        this.totalBalance = totalBalance;
        this.transactionDate = transactionDate;
        this.description = description;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public int getRecipientId() {
        return recipientId;
    }

    public void setRecipientId(int recipientId) {
        this.recipientId = recipientId;
    }

    public String getTransactionType() {
        return transactionType;
    }

    public void setTransactionType(String transactionType) {
        this.transactionType = transactionType;
    }

    public double getAmount() {
        return amount;
    }

    public void setAmount(double amount) {
        this.amount = amount;
    }

    public double getTotalBalance() {
        return totalBalance;
    }

    public void setTotalBalance(double totalBalance) {
        this.totalBalance = totalBalance;
    }

    public Timestamp getTransactionDate() {
        return transactionDate;
    }

    public void setTransactionDate(Timestamp transactionDate) {
        this.transactionDate = transactionDate;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
}